<template>
	<el-card class="layout-query">
		<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList()">
			<el-form-item label="关键词" prop="keyword">
				<el-input v-model="state.queryForm.keyword" placeholder="请输入">
					<template #prepend>
						<el-select v-model="state.queryForm.keyType" placeholder="请选择" style="width: 100px; min-width: 100px">
							<el-option label="标准编号" value="1" />
							<el-option label="标准名称" value="2" />
							<el-option label="标准单位" value="3" />
						</el-select>
					</template>
				</el-input>
			</el-form-item>
			<el-form-item label="复审状态" prop="status">
				<el-select v-model="state.queryForm.status" placeholder="请选择" style="width: 100%">
					<el-option label="采集中" value="1"></el-option>
					<el-option label="已提交" value="2"></el-option>
					<el-option label="已退回" value="3"></el-option>
					<el-option label="已发布" value="4"></el-option>
					<el-option label="不通过" value="5"></el-option>
				</el-select>
			</el-form-item>
			<el-form-item>
				<el-button icon="Search" type="primary" @click="getDataList()">查询</el-button>
			</el-form-item>
			<el-form-item>
				<el-button icon="RefreshRight" @click="reset()">重置</el-button>
			</el-form-item>
		</el-form>
	</el-card>
	<el-card>
		<el-space>
			<el-space>
				<el-button type="primary" @click="addOrUpdateHandle()">发布</el-button>
			</el-space>
			<el-space>
				<el-button type="primary" @click="addOrUpdateHandle()">取消发布</el-button>
			</el-space>
		</el-space>
		<el-table v-loading="state.dataListLoading" :data="state.dataList" stripe class="layout-table" @selection-change="selectionChangeHandle">
			<el-table-column type="selection" header-align="center" align="center" width="55" />
			<el-table-column type="index" label="序号" header-align="center" align="center" width="60"></el-table-column>
			<el-table-column prop="name" label="团体标准名称" header-align="center" align="center"></el-table-column>
			<el-table-column prop="code" label="标准编号" header-align="center" align="center"></el-table-column>
			<el-table-column prop="unit" label="发布单位" header-align="center" align="center"></el-table-column>
			<el-table-column prop="date" label="发布日期" header-align="center" align="center"></el-table-column>
			<el-table-column prop="status" label="状态" header-align="center" align="center"></el-table-column>
			<el-table-column prop="fileStatus" label="文件上传状态" header-align="center" align="center"></el-table-column>
			<el-table-column label="操作" fixed="right" header-align="center" align="center" width="120">
				<template #default="scope">
					<el-icon :size="16" color="#1491FF" title="查看" style="cursor: pointer; margin: 0 6px">
						<View />
					</el-icon>
					<el-icon :size="16" color="#1491FF" title="编辑" style="cursor: pointer; margin: 0 6px">
						<Edit />
					</el-icon>
					<el-icon :size="16" color="#1491FF" title="不通过" style="cursor: pointer; margin: 0 6px">
						<Remove />
					</el-icon>
					<el-icon :size="16" color="#1491FF" title="退回" style="cursor: pointer; margin: 0 6px">
						<CircleClose />
					</el-icon>
				</template>
			</el-table-column>
		</el-table>
		<el-pagination
			:current-page="state.page"
			:page-sizes="state.pageSizes"
			:page-size="state.limit"
			:total="state.total"
			layout="total, sizes, prev, pager, next, jumper"
			@size-change="sizeChangeHandle"
			@current-change="currentChangeHandle"
		>
		</el-pagination>

		<!-- 弹窗, 新增 / 修改 -->
		<!-- <add-or-update ref="addOrUpdateRef" @refresh-data-list="getDataList"></add-or-update> -->
	</el-card>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { IHooksOptions } from '@/hooks/interface'
import key from '@/utils/cache/key'
const state: IHooksOptions = reactive({
	dataListUrl: '/sys/post/page',
	deleteUrl: '/sys/post',
	queryForm: {
		keyword: '',
		keyType: '',
		year: '',
		souce: '',
		date: ''
	},
	pageNum: 1,
	pageSize: 10,
	total: 1,
	dataListLoading: false,
	dataList: [
		{
			id: '1',
			name: '标准名称1',
			code: '11',
			date: '2022-01-01',
			unit: '广东技术大学',
			status: '已发布',
			fileStatus: '待上传'
		}
	]
})

const getDataList = () => {}

const reset = () => {}

const addOrUpdateHandle = () => {}
const deleteBatchHandle = () => {}
const selectionChangeHandle = () => {}
const sizeChangeHandle = () => {}
const currentChangeHandle = () => {}
const getDataListParent = () => {}
</script>
